import 'package:flutter/material.dart';
import 'package:navigator_demo/navigator2pointzero/router/app_router_delegate.dart';
import 'package:navigator_demo/navigator2pointzero/router/app_router_factory.dart';
import 'package:navigator_demo/navigator2pointzero/router/app_router_information_parser.dart';
import 'package:navigator_demo/navigator2pointzero/router/app_router_information_provider.dart';

import 'navigator2pointzero/bottom_bar_menu/master_bottom_bar_page.dart';

void main() {
  runApp(Shell2());
}

class Shell extends StatefulWidget {
  @override
  _ShellState createState() => _ShellState();
}

class _ShellState extends State<Shell> {
  final appRouterDelgate = AppRouterDelegate(
    routeFactory: AppRouterFactory.routeFactory,
  );
  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Navigator 2.0 Demo',
      theme: ThemeData(
        primaryColor: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      routeInformationParser: AppRouterInformationParser(),
      routerDelegate: appRouterDelgate,
      routeInformationProvider: AppRouterInformationProvider(location: '/'),
    );
  }
}

class Shell2 extends StatefulWidget {
  @override
  _Shell2State createState() => _Shell2State();
}

class _Shell2State extends State<Shell2> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Navigator 2.0 Demo',
      theme: ThemeData(
        primaryColor: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: BottmBarMenuGuestPage(
        tabIndexNotifier: ValueNotifier<int>(0),
      ),
    );
  }
}
